//
//  Controller17.swift
//  Swift30Days
//
//  Created by licheng ke on 2017/3/9.
//  Copyright © 2017年 licheng ke. All rights reserved.
//

import UIKit

//TumblrMenu
class Controller17: UIViewController {
    
    let myTransition = TransitionMeun()
    
    override func viewDidLoad() {
        super.viewDidLoad()
        configUI();
        
        //设置present的形式
        self.modalPresentationStyle = .custom;
    }
    
    //设置UI
    
    func configUI(){
        super.viewDidLoad()
        let imageView = UIImageView(frame: view.bounds);
        imageView.image = #imageLiteral(resourceName: "blue");
        self.view.addSubview(imageView);
        
        let button = UIButton(frame: CGRect(x: SCREEN_W * 0.5 - 60, y: SCREEN_H - 100, width: 120, height: 40))
        button.setTitle("present", for: .normal);
        button.setTitleColor(.red, for: .normal);
        button.addTarget(self, action: #selector(tapAction), for: .touchUpInside);
        view.addSubview(button);
    }

    
    func tapAction(){
        let controller = Controller17_2(nibName: "Controller17_2", bundle: nil);
        controller.transitioningDelegate = myTransition;
        self.present(controller, animated: true, completion: nil);
    }
    
    
    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
    }
    


}
